1. Field of the Invention
The present invention relates to an image processing apparatus, an image pickup apparatus, an image processing method and a non-transitory computer-readable medium which perform tone conversion of an image constituted by pixels that have a plurality of color signals.
2. Description of the Related Art
Technology has already been proposed which performs tone conversion with respect to an image obtained by an image pickup operation, so that an image having appropriate tones is displayed on a display apparatus or so that an image having appropriate tones is printed by a printing apparatus.
In a case where an input image is constituted by a plurality of color signals, if tone conversion is performed for each color signal, the chroma and hue will change. This is because gamma conversion is a non-linear conversion, and therefore, for example, if a gamma conversion γ( ) is performed with respect to three primary color signals RGB that are inputted, a pre-conversion color signal ratio R:G:B and a post-conversion color signal ratio γ(R):γ(G):γ(B) generally will not match, and thus the amounts of chroma and hue are not preserved by the gamma conversion γ( ).
Therefore, technology has been proposed which is designed to perform tone conversion of a luminance component, but to suppress changes with respect to the chroma and hue.
For example, according to technology described in Japanese Patent No. 2748678, first, a luminance signal Y is created based on a plurality of color signals R, G and B, and next a correction coefficient K is calculated based on a ratio Y′/Y between the luminance signal Y and a signal Y′ obtained by subjecting the luminance signal Y to gamma conversion. Subsequently, color signals R′, G′ and B′ after tone conversion are calculated by multiplying the calculated correction coefficient K by the plurality of color signals R, G and B, respectively. Since a color signal ratio R′:G′:B′ of the color signals R′, G′ and B′ after the tone conversion that were multiplied by the common correction coefficient K in this way is identical to the color signal ratio R:G:B before the tone conversion, the chroma and hue do not change as a result of the tone conversion.
Further, according to technology disclosed in Japanese Patent No. 5248928, an image is divided into a plurality of regions, an average luminance value is calculated for each region, and the higher the average luminance value is, the larger the value to which a dynamic range expansion ratio is set. Further, a tone curve is applied that increases the degree to which a high luminance region is compressed as the dynamic range expansion ratio increases, to thereby amplify the level of an intermediate luminance region. In addition, as the dynamic range expansion ratio becomes larger and the number of high luminance regions increases, at least one amount among a gain correction amount, a diaphragm value correction amount, a shutter speed correction amount and an exposure value correction amount is increased. According to the technology disclosed in the aforementioned Japanese Patent No. 5248928, the dynamic range is expanded in this manner.
A gamma conversion curve (for example, a gamma conversion curve described in the aforementioned Japanese Patent No. 5248928) generally has a shape in which a slope increases as the curve moves to a low luminance region, and in which the slope gradually decreases as the curve moves to a high luminance region. When tone conversion is performed using the kind of gamma conversion curve, a decrease in chroma is liable to arise, in particular, on a high luminance side on which the slope of the gamma conversion curve decreases.
First, in a case where R=G=B, which is the case of an achromatic color, a pre-conversion color signal ratio R:G:B and a post-conversion color signal ratio γ(R):γ(G):γ(B) are each 1:1:1, and are thus equal.
In contrast, in the case of a chromatic color in which a signal value of at least one color signal among the color signals R, G and B is different to the signal values of the other color signals, if tone conversion is performed using the aforementioned gamma conversion curve, although the amplification factor of a color signal having the highest signal value will become a comparatively small value that is close to 1, the amplification factor of a color signal having a low signal value will become significantly greater than 1 and consequently the color signal ratios before and after conversion will not be equal. Accordingly, while both the chroma and hue will change, in relation to the chroma in particular, it is known that the color will approach an achromatic color because the color signal ratio will come close to 1:1:1.